package com.lgrousset.loanssimulator.client.chart.widget;

import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;

public class LoanField extends Composite {
	private HorizontalPanel panel = new HorizontalPanel();
	private TextBox textBox = new TextBox();
	private Label label = new Label();

	public LoanField() {
		panel.add(label);
		panel.add(textBox);
		initWidget(panel);
	}

	public void addChangeHandler(ChangeHandler handler) {
		textBox.addChangeHandler(handler);
	}

	public void setLabel(String labelStr) {
		label.setText(labelStr);
	}
	
	public void setValue(String value) {
		textBox.setValue(value);
	}
	
	public String getValue() {
		return textBox.getValue();
	}
}
